<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    button{
        width: 100px;
        height: 100px;
    }
    iframe{
        width: 100px;
        height: 100px
    }
</style>
<body>
    <button>
        
    </button>
    <iframe src="./iframe.html" frameborder="0"></iframe>
</body>
<script>
    const button=document.querySelector('button')
    button.addEventListener('click',function(){
        document.querySelector('iframe').contentWindow.postMessage('动感光波','*')
        return false
    })
</script>
</html>